package com.dl.live.util;

import org.springframework.beans.BeanUtils;

public class ConvertBeanUtil {

    public static <T> T convertBean(Object source, Class<T> target) {
        if (source == null) {
            return null;
        }
        T targetObject = null;
        try {
            targetObject = target.newInstance();
            BeanUtils.copyProperties(source, targetObject);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return targetObject;
    }



}
